<%@ page import="com.jkt.rms.commons.includes.*"%>
<%@ page import="java.util.*"%>
<%@ page import="com.jkt.rms.business.*"%>

<%@ include file="/WEB-INF/jsp/include.jsp"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="/spring"%>

<html>
<head>
<title><fmt:message key="lbl.title.searchAddRate" /></title>
<script language="javascript"
	src="<%=PathDefinations.jsPath%>calendar.js"></script>
<script language="javascript">

<%Calendar calendar = Calendar.getInstance();

			String month = String.valueOf((calendar.get(Calendar.MONTH)) + 1);
			String date = String.valueOf(calendar.get(Calendar.DATE));
			String serverdate;
			int year = calendar.get(calendar.YEAR);
			if (month.length() < 2) {
				month = "0" + month;
			}
			if (date.length() < 2) {
				date = "0" + date;
			}%>

	var serverdate = '<%=date + "/" + month + "/" + year%>';
</script>
</head>
<body>
<center><br>
<div id="headerbar"><fmt:message key="lbl.title.searchAddRate" /></div>

<spring:nestedPath path="rateBean">
	<div id="content">
	<div><form:form method="POST" commandName="rateBean"
		name="rateBean" action="searchAddRate.htm?method=addRate">

		<c:if test="${ not empty errors.allErrors}">
			<div id="errorFieldSet" class="errorFieldSet">
			<fieldset><legend>Errors</legend> <c:forEach var="err"
				items="${errors.allErrors}">
				<spring:message code="${err.code}" arguments="${err.arguments}" />
				<br />
			</c:forEach></fieldset>
			</div>
		</c:if>
		<c:if test="${ not empty rateBean.message}">
			<div id="messageFieldSet" class="messageFieldSet">
			<fieldset><legend>Messages</legend> <spring:message
				code="${rateBean.message}" /> <br />
			</fieldset>
			</div>
		</c:if>

		<table width="70%" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<tr>

			</tr>
			<tr>
				<td align='left'>&nbsp;</td>
			</tr>
			<tr>
				<td align='left' class=header><label>Vendor Name:</label></td>
				<td align='left' class=value><form:select path="vendorCode">
					<form:option value="0" label="Select" />
					<form:options items="${rateBean.vendorList}" itemValue="id"
						itemLabel="name" />
				</form:select></td>
				<td align='left' class=value>&nbsp;</td>

				<td align='left'><label>Role Name:</label></td>
				<td align='left' class=value><form:select path="roleCode">
					<form:option value="0" label="Select" />
					<form:options items="${rateBean.roleList}" itemValue="id"
						itemLabel="name" />
				</form:select></td>
			</tr>

			<tr>
				<td align='left' class=header><label>Location:</label></td>
				<td align='left' class=value><form:select path="locationCode">
					<form:option value="0" label="Select" />
					<form:options items="${rateBean.locationList}" itemValue="id"
						itemLabel="name" />
				</form:select></td>
			</tr>

			<tr>
				<td><label>Start Date:</label></td>
				<td><form:input path="startdateStr" maxlength="10"
					readonly="true" /> <a
					href="javascript:setdate('',document.getElementById('startdateStr'))"
					class="calender"><img
					src="<%=PathDefinations.imagePath%>cal.gif" width="16" height="16"
					border="0" /></a></td>
				<td align='left' class=value>&nbsp;</td>
				
				<td><label>End Date:</label></td>
				<td><form:input path="enddateStr" maxlength="10"
					readonly="true" /> <a
					href="javascript:setdate('',document.getElementById('enddateStr'))"
					class="calender"><img
					src="<%=PathDefinations.imagePath%>cal.gif" width="16" height="16"
					border="0" /></a></td>
			</tr>

			<tr>
				<td><label>Rate (per Day):</label></td>
				<td><form:input path="rate" maxlength="10" /></td>
				<td align='left' class=value>&nbsp;</td>

				<td align='left'><label>Currency:</label></td>
				<td align='left' class=value><form:select path="currencyId">
					<form:option value="0" label="Select" />
					<form:options items="${rateBean.currencyList}" itemValue="id"
						itemLabel="name" />
				</form:select></td>
			</tr>


		</table>
		<table>
			<tr>
				<td align="left"><input class="value" type='submit'
					name='button' value='Add' title=""></td>
				<td align="left"><input class="value" type='button'
					name='button' value='Reset' title=""></td>
			</tr>
		</table>
	</form:form></div>
	<p></p>
	<br>
	</div>
</spring:nestedPath> <%@ include file="footer.jsp"%></center>
</body>
</html>
